﻿@model Bibilioteca.Models.Material

@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

@if (Model.Id != 0)
{ 
    
<fieldset>
    <legend>Material</legend>

    <div class="display-label">
         <b>Codigo</b>
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Codigo)
    </div>

    <div class="display-label">
         <b>Titulo</b>
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Titulo)
    </div>

    <div class="display-label">
         <b>Autor(es)</b>
    </div>
    <div class="display-field">
        @ViewBag.Autores
    </div>

    <div class="display-label">
         <b>Tipo de Material</b>
    </div>
    <div class="display-field">
        @ViewBag.TiposMateriales
    </div>

    <div class="display-label">
         <b>Sinopsis</b>
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Sinopsis)
    </div>

    <div class="display-label">
         <b>Editorial</b>
    </div>
    <div class="display-field">
        @ViewBag.Editoriales
    </div>

    <div class="display-label">
         <b>Catalogo</b>
    </div>
    <div class="display-field">
        @ViewBag.Catalogos
    </div>

    
    <div class="display-label">
         <br/><b>Ejemplares</b>
    </div>
    <div class="display-field">
    <table>
        <tr><th>ID</th><th>Estado</th></tr>
        @foreach (var tipo in ViewBag.Ejemplares as List<string[]>)
        {
                <tr>
                    <td>
                    @Html.DisplayFor(modelItem => tipo[0])
                    </td>
                    <td>
                    @Html.DisplayFor(modelItem => tipo[1])
                    </td>
                    <td>
                    @Html.ActionLink("Editar", "Edit", "Ejemplares", new { id = tipo[0] }, null)
                    </td>
                    <td>
                    @Html.ActionLink("Eliminar", "Delete", "Ejemplares", new { id = tipo[0] }, null)
                    </td>
                </tr>
        }
    </table>
    </div>


</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.Id }) |
    @Html.ActionLink("Crear Ejemplares", "Create", "Ejemplares", new { id = Model.Id }, null) |
    @Html.ActionLink("Back to List", "Index")
</p>
}
else
{ 
     <p>Este usuario no existe </p>
    <div>
        @Html.ActionLink("Back to List", "Index")
    </div>
}
